<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>老乡烧菜馆 点餐</title>
  <style>
    body { font-family: "Microsoft YaHei", sans-serif; margin: 16px; }
    h1 { margin: 4px 0 8px; }
    .tip { color:#666; margin:0 0 14px; }
    h2 { color: #b22222; border-bottom: 2px solid #eee; padding-bottom: 6px; }
    .menu-section { margin-bottom: 26px; }
    label.item { display:flex; align-items:center; gap:8px; margin:6px 0; flex-wrap: wrap; }
    .name { width: 210px; max-width: 60vw; display:inline-block; }
    input[type='number'] { width: 76px; padding: 4px; }
    .bar { position: sticky; bottom: 0; background: #fff; padding: 12px 0; border-top:1px solid #eee; display:flex; gap:10px; align-items:center; flex-wrap:wrap;}
    .btn { padding: 10px 16px; background:#b22222; color:#fff; border:none; border-radius:4px; cursor:pointer; }
    .total { font-weight: bold; }
    textarea { width:100%; height:120px; }
  </style>
</head>
<body>
  <h1>🍴 老乡烧菜馆 点餐系统</h1>
  <p class="tip">勾选菜品并填写数量，系统将自动计算总价；点击提交可复制清单。</p>
  <form id="orderForm">
<div class='menu-section'><h2>特色小炒</h2>
<label class='item'><input type='checkbox' class='dish' data-name='风味肉片' data-price='30'><span class='name'>风味肉片（30元）</span>数量 <input type='number' class='qty' name='风味肉片数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='香辣花甲' data-price='26'><span class='name'>香辣花甲（26元）</span>数量 <input type='number' class='qty' name='香辣花甲数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='松仁玉米' data-price='16'><span class='name'>松仁玉米（16元）</span>数量 <input type='number' class='qty' name='松仁玉米数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='回锅牛肉' data-price='38'><span class='name'>回锅牛肉（38元）</span>数量 <input type='number' class='qty' name='回锅牛肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='芹菜炒鱿鱼丝' data-price='38'><span class='name'>芹菜炒鱿鱼丝（38元）</span>数量 <input type='number' class='qty' name='芹菜炒鱿鱼丝数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='农家豆腐' data-price='18'><span class='name'>农家豆腐（18元）</span>数量 <input type='number' class='qty' name='农家豆腐数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='回锅肉' data-price='32'><span class='name'>回锅肉（32元）</span>数量 <input type='number' class='qty' name='回锅肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='辣椒炒油渣' data-price='20'><span class='name'>辣椒炒油渣（20元）</span>数量 <input type='number' class='qty' name='辣椒炒油渣数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='小炒猪头肉' data-price='30'><span class='name'>小炒猪头肉（30元）</span>数量 <input type='number' class='qty' name='小炒猪头肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='小炒牛肉' data-price='38'><span class='name'>小炒牛肉（38元）</span>数量 <input type='number' class='qty' name='小炒牛肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='炒鸭杂' data-price='26'><span class='name'>炒鸭杂（26元）</span>数量 <input type='number' class='qty' name='炒鸭杂数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='茄子豆角' data-price='18'><span class='name'>茄子豆角（18元）</span>数量 <input type='number' class='qty' name='茄子豆角数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='小炒猪耳' data-price='30'><span class='name'>小炒猪耳（30元）</span>数量 <input type='number' class='qty' name='小炒猪耳数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酱香山药' data-price='22'><span class='name'>酱香山药（22元）</span>数量 <input type='number' class='qty' name='酱香山药数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='荷包辣椒' data-price='18'><span class='name'>荷包辣椒（18元）</span>数量 <input type='number' class='qty' name='荷包辣椒数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='红烧肥肠' data-price='48'><span class='name'>红烧肥肠（48元）</span>数量 <input type='number' class='qty' name='红烧肥肠数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='肉沫茄子' data-price='22'><span class='name'>肉沫茄子（22元）</span>数量 <input type='number' class='qty' name='肉沫茄子数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='碎椒炒蛋' data-price='18'><span class='name'>碎椒炒蛋（18元）</span>数量 <input type='number' class='qty' name='碎椒炒蛋数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='辣椒炒牛肚' data-price='38'><span class='name'>辣椒炒牛肚（38元）</span>数量 <input type='number' class='qty' name='辣椒炒牛肚数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='韭菜炒蛋' data-price='18'><span class='name'>韭菜炒蛋（18元）</span>数量 <input type='number' class='qty' name='韭菜炒蛋数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='蛋饼' data-price='16'><span class='name'>蛋饼（16元）</span>数量 <input type='number' class='qty' name='蛋饼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酸豆角炒鸭胗' data-price='28'><span class='name'>酸豆角炒鸭胗（28元）</span>数量 <input type='number' class='qty' name='酸豆角炒鸭胗数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='南昌炒三丝' data-price='18'><span class='name'>南昌炒三丝（18元）</span>数量 <input type='number' class='qty' name='南昌炒三丝数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酱爆藕片' data-price='18'><span class='name'>酱爆藕片（18元）</span>数量 <input type='number' class='qty' name='酱爆藕片数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='韭香螺狮肉' data-price='26'><span class='name'>韭香螺狮肉（26元）</span>数量 <input type='number' class='qty' name='韭香螺狮肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='西红柿炒蛋' data-price='18'><span class='name'>西红柿炒蛋（18元）</span>数量 <input type='number' class='qty' name='西红柿炒蛋数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='骨肉相连' data-price='26'><span class='name'>骨肉相连（26元）</span>数量 <input type='number' class='qty' name='骨肉相连数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='腐竹烧肉' data-price='28'><span class='name'>腐竹烧肉（28元）</span>数量 <input type='number' class='qty' name='腐竹烧肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='地皮菇炒蛋' data-price='18'><span class='name'>地皮菇炒蛋（18元）</span>数量 <input type='number' class='qty' name='地皮菇炒蛋数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='香芋地瓜丸' data-price='16'><span class='name'>香芋地瓜丸（16元）</span>数量 <input type='number' class='qty' name='香芋地瓜丸数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='余干椒炒肉' data-price='28'><span class='name'>余干椒炒肉（28元）</span>数量 <input type='number' class='qty' name='余干椒炒肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='咸鱼茄子煲' data-price='22'><span class='name'>咸鱼茄子煲（22元）</span>数量 <input type='number' class='qty' name='咸鱼茄子煲数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='糖醋里脊肉' data-price='26'><span class='name'>糖醋里脊肉（26元）</span>数量 <input type='number' class='qty' name='糖醋里脊肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='辣椒炒肉' data-price='28'><span class='name'>辣椒炒肉（28元）</span>数量 <input type='number' class='qty' name='辣椒炒肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='松香日本豆腐' data-price='18'><span class='name'>松香日本豆腐（18元）</span>数量 <input type='number' class='qty' name='松香日本豆腐数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='粉丝包菜' data-price='20'><span class='name'>粉丝包菜（20元）</span>数量 <input type='number' class='qty' name='粉丝包菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='烟笋烧肉' data-price='28'><span class='name'>烟笋烧肉（28元）</span>数量 <input type='number' class='qty' name='烟笋烧肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='腊味娃娃菜' data-price='20'><span class='name'>腊味娃娃菜（20元）</span>数量 <input type='number' class='qty' name='腊味娃娃菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='麻辣粉丝煲' data-price='16'><span class='name'>麻辣粉丝煲（16元）</span>数量 <input type='number' class='qty' name='麻辣粉丝煲数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='木耳炒肉' data-price='22'><span class='name'>木耳炒肉（22元）</span>数量 <input type='number' class='qty' name='木耳炒肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='私房菜' data-price='18'><span class='name'>私房菜（18元）</span>数量 <input type='number' class='qty' name='私房菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='豆泡烧豆芽' data-price='20'><span class='name'>豆泡烧豆芽（20元）</span>数量 <input type='number' class='qty' name='豆泡烧豆芽数量' min='1' value='1' disabled></label>
</div>
<div class='menu-section'><h2>田园时蔬</h2>
<label class='item'><input type='checkbox' class='dish' data-name='蒜蓉空心菜' data-price='15'><span class='name'>蒜蓉空心菜（15元）</span>数量 <input type='number' class='qty' name='蒜蓉空心菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='油淋生菜' data-price='15'><span class='name'>油淋生菜（15元）</span>数量 <input type='number' class='qty' name='油淋生菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酸辣包菜' data-price='16'><span class='name'>酸辣包菜（16元）</span>数量 <input type='number' class='qty' name='酸辣包菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='清炒韭菜' data-price='15'><span class='name'>清炒韭菜（15元）</span>数量 <input type='number' class='qty' name='清炒韭菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='油淋青菜' data-price='15'><span class='name'>油淋青菜（15元）</span>数量 <input type='number' class='qty' name='油淋青菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酸辣土豆丝' data-price='18'><span class='name'>酸辣土豆丝（18元）</span>数量 <input type='number' class='qty' name='酸辣土豆丝数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='清炒莴笋' data-price='18'><span class='name'>清炒莴笋（18元）</span>数量 <input type='number' class='qty' name='清炒莴笋数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='清炒腐竹' data-price='16'><span class='name'>清炒腐竹（16元）</span>数量 <input type='number' class='qty' name='清炒腐竹数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='油麦菜' data-price='15'><span class='name'>油麦菜（15元）</span>数量 <input type='number' class='qty' name='油麦菜数量' min='1' value='1' disabled></label>
</div>
<div class='menu-section'><h2>无辣不欢</h2>
<label class='item'><input type='checkbox' class='dish' data-name='牛筋烧牛腩' data-price='98'><span class='name'>牛筋烧牛腩（98元）</span>数量 <input type='number' class='qty' name='牛筋烧牛腩数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='甲鱼仔' data-price='58'><span class='name'>甲鱼仔（58元）</span>数量 <input type='number' class='qty' name='甲鱼仔数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='螃蟹脚' data-price='58'><span class='name'>螃蟹脚（58元）</span>数量 <input type='number' class='qty' name='螃蟹脚数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='鸭三件' data-price='48'><span class='name'>鸭三件（48元）</span>数量 <input type='number' class='qty' name='鸭三件数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='凤爪烧黄豆' data-price='38'><span class='name'>凤爪烧黄豆（38元）</span>数量 <input type='number' class='qty' name='凤爪烧黄豆数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='牛腩烧红烧肉' data-price='68'><span class='name'>牛腩烧红烧肉（68元）</span>数量 <input type='number' class='qty' name='牛腩烧红烧肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='香辣小青蛙' data-price='58'><span class='name'>香辣小青蛙（58元）</span>数量 <input type='number' class='qty' name='香辣小青蛙数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='牛蛙' data-price='58'><span class='name'>牛蛙（58元）</span>数量 <input type='number' class='qty' name='牛蛙数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干煸鸭头' data-price='58'><span class='name'>干煸鸭头（58元）</span>数量 <input type='number' class='qty' name='干煸鸭头数量' min='1' value='1' disabled></label>
</div>
<div class='menu-section'><h2>经典烧菜</h2>
<label class='item'><input type='checkbox' class='dish' data-name='手抓牛龙骨' data-price='78'><span class='name'>手抓牛龙骨（78元）</span>数量 <input type='number' class='qty' name='手抓牛龙骨数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='川味毛血旺' data-price='42'><span class='name'>川味毛血旺（42元）</span>数量 <input type='number' class='qty' name='川味毛血旺数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='铁板基尾虾' data-price='48'><span class='name'>铁板基尾虾（48元）</span>数量 <input type='number' class='qty' name='铁板基尾虾数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='金牌牛脚' data-price='98'><span class='name'>金牌牛脚（98元）</span>数量 <input type='number' class='qty' name='金牌牛脚数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='香菇猪尾' data-price='48'><span class='name'>香菇猪尾（48元）</span>数量 <input type='number' class='qty' name='香菇猪尾数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='极品猪脚' data-price='58'><span class='name'>极品猪脚（58元）</span>数量 <input type='number' class='qty' name='极品猪脚数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='红烧羊排' data-price='78'><span class='name'>红烧羊排（78元）</span>数量 <input type='number' class='qty' name='红烧羊排数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='口水鸡' data-price='38'><span class='name'>口水鸡（38元）</span>数量 <input type='number' class='qty' name='口水鸡数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='乡下红烧肉' data-price='58'><span class='name'>乡下红烧肉（58元）</span>数量 <input type='number' class='qty' name='乡下红烧肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='啤酒烧鸭' data-price='58'><span class='name'>啤酒烧鸭（58元）</span>数量 <input type='number' class='qty' name='啤酒烧鸭数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='金牌飘香肉' data-price='48'><span class='name'>金牌飘香肉（48元）</span>数量 <input type='number' class='qty' name='金牌飘香肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='莲藕烧排骨' data-price='48'><span class='name'>莲藕烧排骨（48元）</span>数量 <input type='number' class='qty' name='莲藕烧排骨数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='红烧土鸡' data-price='58'><span class='name'>红烧土鸡（58元）</span>数量 <input type='number' class='qty' name='红烧土鸡数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='砂钵牛腩' data-price='58'><span class='name'>砂钵牛腩（58元）</span>数量 <input type='number' class='qty' name='砂钵牛腩数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='蛋白烧肉丸' data-price='38'><span class='name'>蛋白烧肉丸（38元）</span>数量 <input type='number' class='qty' name='蛋白烧肉丸数量' min='1' value='1' disabled></label>
</div>
<div class='menu-section'><h2>鲜活鱼类</h2>
<label class='item'><input type='checkbox' class='dish' data-name='臭桂鱼' data-price='58'><span class='name'>臭桂鱼（58元）</span>数量 <input type='number' class='qty' name='臭桂鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='红烧鲫鱼' data-price='46'><span class='name'>红烧鲫鱼（46元）</span>数量 <input type='number' class='qty' name='红烧鲫鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='剁椒鱼头' data-price='58'><span class='name'>剁椒鱼头（58元）</span>数量 <input type='number' class='qty' name='剁椒鱼头数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='臭鲈鱼' data-price='48'><span class='name'>臭鲈鱼（48元）</span>数量 <input type='number' class='qty' name='臭鲈鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='黄丫头烧豆腐' data-price='42'><span class='name'>黄丫头烧豆腐（42元）</span>数量 <input type='number' class='qty' name='黄丫头烧豆腐数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='红烧小黄鱼' data-price='30'><span class='name'>红烧小黄鱼（30元）</span>数量 <input type='number' class='qty' name='红烧小黄鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='卤水白鱼' data-price='42'><span class='name'>卤水白鱼（42元）</span>数量 <input type='number' class='qty' name='卤水白鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酸菜水煮鱼' data-price='48'><span class='name'>酸菜水煮鱼（48元）</span>数量 <input type='number' class='qty' name='酸菜水煮鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='秘制清江烤鱼' data-price='68'><span class='name'>秘制清江烤鱼（68元）</span>数量 <input type='number' class='qty' name='秘制清江烤鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='红烧草鱼' data-price='36'><span class='name'>红烧草鱼（36元）</span>数量 <input type='number' class='qty' name='红烧草鱼数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='鱼头烧豆腐' data-price='48'><span class='name'>鱼头烧豆腐（48元）</span>数量 <input type='number' class='qty' name='鱼头烧豆腐数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='老乡烤鱼' data-price='48'><span class='name'>老乡烤鱼（48元）</span>数量 <input type='number' class='qty' name='老乡烤鱼数量' min='1' value='1' disabled></label>
</div>
<div class='menu-section'><h2>干锅类</h2>
<label class='item'><input type='checkbox' class='dish' data-name='干锅羊肉' data-price='98'><span class='name'>干锅羊肉（98元）</span>数量 <input type='number' class='qty' name='干锅羊肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干锅牛杂' data-price='38'><span class='name'>干锅牛杂（38元）</span>数量 <input type='number' class='qty' name='干锅牛杂数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干锅花菜' data-price='22'><span class='name'>干锅花菜（22元）</span>数量 <input type='number' class='qty' name='干锅花菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='锅仔狗肉' data-price='88'><span class='name'>锅仔狗肉（88元）</span>数量 <input type='number' class='qty' name='锅仔狗肉数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干锅千叶豆腐' data-price='22'><span class='name'>干锅千叶豆腐（22元）</span>数量 <input type='number' class='qty' name='干锅千叶豆腐数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干锅包菜' data-price='22'><span class='name'>干锅包菜（22元）</span>数量 <input type='number' class='qty' name='干锅包菜数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='茶树菇肥肠' data-price='58'><span class='name'>茶树菇肥肠（58元）</span>数量 <input type='number' class='qty' name='茶树菇肥肠数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干锅土豆片' data-price='22'><span class='name'>干锅土豆片（22元）</span>数量 <input type='number' class='qty' name='干锅土豆片数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='干锅脆笋' data-price='22'><span class='name'>干锅脆笋（22元）</span>数量 <input type='number' class='qty' name='干锅脆笋数量' min='1' value='1' disabled></label>
</div>
<div class='menu-section'><h2>保健靓汤</h2>
<label class='item'><input type='checkbox' class='dish' data-name='海带排骨汤' data-price='32'><span class='name'>海带排骨汤（32元）</span>数量 <input type='number' class='qty' name='海带排骨汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='萝卜排骨汤' data-price='32'><span class='name'>萝卜排骨汤（32元）</span>数量 <input type='number' class='qty' name='萝卜排骨汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='西红柿蛋汤' data-price='15'><span class='name'>西红柿蛋汤（15元）</span>数量 <input type='number' class='qty' name='西红柿蛋汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='玉米排骨汤' data-price='32'><span class='name'>玉米排骨汤（32元）</span>数量 <input type='number' class='qty' name='玉米排骨汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='雪梨肉饼汤' data-price='32'><span class='name'>雪梨肉饼汤（32元）</span>数量 <input type='number' class='qty' name='雪梨肉饼汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='三鲜汤' data-price='15'><span class='name'>三鲜汤（15元）</span>数量 <input type='number' class='qty' name='三鲜汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='莲藕排骨汤' data-price='32'><span class='name'>莲藕排骨汤（32元）</span>数量 <input type='number' class='qty' name='莲藕排骨汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='家乡蛋汤' data-price='15'><span class='name'>家乡蛋汤（15元）</span>数量 <input type='number' class='qty' name='家乡蛋汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='酸辣汤' data-price='15'><span class='name'>酸辣汤（15元）</span>数量 <input type='number' class='qty' name='酸辣汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='山药排骨汤' data-price='32'><span class='name'>山药排骨汤（32元）</span>数量 <input type='number' class='qty' name='山药排骨汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='紫菜蛋汤' data-price='15'><span class='name'>紫菜蛋汤（15元）</span>数量 <input type='number' class='qty' name='紫菜蛋汤数量' min='1' value='1' disabled></label>
<label class='item'><input type='checkbox' class='dish' data-name='榨菜肉丝汤' data-price='15'><span class='name'>榨菜肉丝汤（15元）</span>数量 <input type='number' class='qty' name='榨菜肉丝汤数量' min='1' value='1' disabled></label>
</div>
    <div class="bar">
      <span class="total">合计：¥<span id="total">0.00</span></span>
      <button class="btn" type="button" onclick="copySummary()">复制清单</button>
      <button class="btn" type="button" onclick="submitOrder()">提交订单</button>
    </div>
    <textarea id="summary" placeholder="清单会显示在这里，长按复制/粘贴到微信…"></textarea>
  </form>
  <script>
    const form = document.getElementById('orderForm');
    const totalEl = document.getElementById('total');
    const summaryEl = document.getElementById('summary');

    function recalc() {
      let total = 0;
      let lines = [];
      document.querySelectorAll('.item').forEach(row => {
        const cb = row.querySelector('.dish');
        const qtyInput = row.querySelector('.qty');
        if (cb.checked) {
          const name = cb.dataset.name;
          const price = parseFloat(cb.dataset.price);
          const qty = Math.max(1, parseInt(qtyInput.value || '1', 10));
          qtyInput.value = qty; // 规范化
          total += price * qty;
          lines.push(`✅ ${name} ${price}元 × ${qty}`);
        }
      });
      totalEl.textContent = total.toFixed(2);
      summaryEl.value = lines.length ? `📝 点餐清单：\n\n${lines.join('\n')}\n\n合计：¥${total.toFixed(2)}` : '';
    }

    // 勾选时启用/禁用数量框，并重算
    form.addEventListener('change', (e) => {
      if (e.target.classList.contains('dish')) {
        const row = e.target.closest('.item');
        const qty = row.querySelector('.qty');
        qty.disabled = !e.target.checked;
        if (e.target.checked && (!qty.value || parseInt(qty.value, 10) < 1)) qty.value = 1;
        recalc();
      }
      if (e.target.classList.contains('qty')) {
        if (parseInt(e.target.value || '0', 10) < 1) e.target.value = 1;
        recalc();
      }
    });

    function submitOrder() {
      if (!summaryEl.value) recalc();
      if (!summaryEl.value) { alert('请先选择至少一道菜~'); return; }
      alert(summaryEl.value);
    }

    function copySummary() {
      if (!summaryEl.value) recalc();
      if (!summaryEl.value) { alert('请先选择至少一道菜~'); return; }
      summaryEl.select();
      document.execCommand('copy');
      alert('清单已复制，可直接粘贴到微信/备注。');
    }
  </script>
</body>
</html>
